package com.personnalManagerSystem.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.personnalManagerSystem.model.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.personnalManagerSystem.model.User2;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author liqing
 * @since 2022-03-27
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(String username, String password);

    List<User2> selectUserDepartmentPosition(@Param(Constants.WRAPPER)QueryWrapper<User2> wrapper);
    @Select("select count(user_id) from user ")
    int selectAllUser();
    @Select("select * from user where username=#{username}")
    User queryUsername(String username);
}
